package test37;

import java.io.*;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-05-09
 * Time: 14:16
 */
public class Main1 {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String str = null;
        while ((str = br.readLine()) != null) {
            int num = Integer.parseInt(str);
            String[] orders = new String[num];
            for (int i = 0; i < num; i++) {
                orders[i] = br.readLine();
            }
            Arrays.sort(orders);
            for (int i = 1; i < num; i++) {
                // 后面是为了排除，/a/ab 和 /a/abc 的情况
                if (orders[i].contains(orders[i - 1]) && orders[i].charAt(orders[i - 1].length()) == '/') {
                    orders[i - 1] = "";
                }
            }
            for (String s : orders) {
                if (!s.equals("")) {
                    bw.write("mkdir -p" + s + "\n");
                }
            }
            bw.write("\n");
        }
        bw.flush();
        bw.close();
        br.close();
    }
}
